﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace testTennis
{
    class Match
    {
        public Set set = new Set();
       
        public int setP1=0, setP2=0;

        public int getSetP1()
        {
            return this.setP1;
        }

        public void setSetP1(int setP1)
        {
            this.setP1 = setP1; 
        }

        public int getSetP2()
        {
            return this.setP2;
        }

        public void setSetP2(int setP2)
        {
            this.setP2 = setP2;
        }

        public string result;

        public void increaseSet()
        {
            //set.winset();
            if (set.result.Equals("P1"))
            {
                setP1++;
            }
            if (set.result.Equals("P2"))
            {
                setP2++;
            }

        }

        public void playMatch()
        {
            while (setP1 < 2 || setP2 < 2)
            {     
                increaseSet();
            }
            result = set.result.ToString();
        }
    }
}
